<template>
  <el-dialog
    top="30px"
    width="95%"
    class="dialog-sm"
    custom-class="dialog-report-month"
    append-to-body
    title="月报收益情况表"
    :visible.sync="visible"
    :close-on-click-modal="false"
    :before-close="beforeClose"
  >
    <supervise-month-profit
      :edit-mode="editMode"
      ref="editMonth"
      @success="onsuccess()"
      @close="beforeClose"
    ></supervise-month-profit>
  </el-dialog>
</template>

<script>
import SuperviseMonthProfit from '@/credit/views/city/report/SuperviseMonthProfit'
export default {
  components: {
    SuperviseMonthProfit,
  },
  props: {
    visible: Boolean,
    editMode: { type: Boolean, default: false },
  },
  data() {
    return {}
  },
  watch: {
    visible() {
      if (this.visible) {
        this.$nextTick(() => {
          this.$refs.editMonth.getData()
        })
      }
    },
  },
  created() {},
  methods: {
    beforeClose() {
      this.$emit('update:visible', false)
    },
    onsuccess() {
      this.$emit('success', true)
    },
  },
}
</script>
<style lang="scss" scoped>
/deep/ .dialog-report-month {
  max-width: 1800px;
}
</style>
